#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

typedef long long ll;
typedef double db;
typedef vector < int > vec;
typedef pair < int , int > pii;

ll read() {
    ll x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 4e5 + 10;

int n, q;

struct bs {
	ll tr[62];
	bs() { memset(tr, 0, sizeof tr); }
	void ins(ll x) {
		per(i, 60, 0)
			if(x >> i & 1ll) {
				if(!tr[i]) {
					tr[i] = x; return;
				} else x ^= tr[i];
			}
	}
	friend bs operator + (bs a, bs b) {
		bs c = a;
		rep(i, 0, 60) if(b.tr[i]) c.ins(b.tr[i]);
		return c;
	}
	bool get(ll x) {
		per(i, 60, 0) if(x >> i & 1ll) {
			if(!tr[i]) return 0;
			x ^= tr[i];
		}
		return 1;
	}
} suf[N], pre[N];

ll a[N], x[N];
vector < tuple < int, int, int > > G[N << 2];
int ans[N];

void ins(int xl, int xr, int v, int o = 1, int l = 1, int r = n) {
	int mid = l + r >> 1; if(l == r) return;
	if(xr <= mid) ins(xl, xr, v, o << 1, l, mid);
	else if(xl > mid) ins(xl, xr, v, o << 1 | 1, mid + 1, r);
	else G[o].pb(make_tuple( xl, xr , v ));
}

void get(int o = 1, int l = 1, int r = n) {
	int mid = l + r >> 1; if(l == r) return;
	pre[mid] = bs(); rep(i, mid + 1, r) pre[i] = pre[i - 1], pre[i].ins(a[i]);
	suf[mid + 1] = bs(); per(i, mid, l) suf[i] = suf[i + 1], suf[i].ins(a[i]);
	for(auto v : G[o]) {
		int xl = get<0>(v), xr = get<1>(v), id = get<2>(v);
		bs t = suf[xl] + pre[xr];
		ans[id] = t.get(x[id]);
	}
	get(o << 1, l, mid); get(o << 1 | 1, mid + 1, r);
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
	n = in, q = in;
	rep(i, 1, n) a[i] = in;
	rep(i, 1, q) { int l = in, r = in; x[i] = in; if(l == r && x[i] == a[l]) ans[i] = 1; if(l != r) ins(l, r, i); }
	get();
	rep(i, 1, q) puts(ans[i] ? "Yes" : "No");
	return 0;
}
